<?php /* @var $this Controller */ ?>
<?php $this->beginContent('//layouts/main'); ?>
<div class="row">

	   <div class="span2">
        <div id="sidebar">
        <div style="text-align: center">
        <?php
        	$user = $_SESSION['user'];
        	echo '<a href='.$this->createUrl('/user/update',array('id'=>$user->id)).' style=\"text-alignment:center\">';
        	$image = Utils::findImageUrl ('default_image.jpg');
        	echo "<image src='$image'>";
            echo $user->username;
            echo "<br>" ;
            echo $user->level;
            echo "</a>"
        ?>
        </div>
        <!-- Desafios Ganhos -->
        <br>
        <ul type="circle">
        	<?php 
				$challenges = Challenge::model()->findAll();
				if(isset($challenges)){
					echo "<h5> Minhas Publicações </h5>";
	        		foreach ($challenges as $challenge) {
						echo "<li>";
		   				echo "<a href=\"view/$challenge->id\">";
		   				echo $challenge->name;
		   				echo "</a>";
						echo "</li>";
	        		}
        		}
        	
        	?>
        </ul>
        
        </div><!-- sidebar -->
    </div>
    <div class="span7" style="margin-left: 100px">
        <div id="content">
            <?php echo $content; ?>
        </div><!-- content -->
    </div>
    <div class="span2">
        <div id="sidebar">
        <?php
            $this->beginWidget('CPortlet', array(
                'title'=>Yii::t('Menu','Operações'),
            ));
            $this->widget('TbMenu', array(
                'items'=>$this->menu,
                'htmlOptions'=>array('class'=>'operations'),
            ));
            $this->endWidget();
        ?>
        </div><!-- sidebar -->
    </div>
</div>
<?php $this->endContent(); ?>